<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Student extends Model
{
    //指定表名
   protected $table = 'student';

   //指定id
    protected $primaryKey = 'id';

    //设置允许批量赋值的字段
    protected $fillable = ['name','age'];

    //设置不允许批量赋值的字段
    protected $guarded = [];

    //自动维护时间戳  关闭开启   created_at  updated_at
    public $timestamps = true;  //true开启时间戳

    //
    protected function getDateFormat()
    {
        return time();
    }

    //
    protected function asDateTime($val)
    {
        return $val;
    }

}
